1. Field of the Invention
The present invention relates generally to an image processing method and an image processing apparatus, in particular, to pixel input-output method for inputting pixels into a memory or outputting pixels from the memory, an image compressing method for compressing a color image after separating a foreground image layer and a background image layer, a pixel input-output apparatus, an image compressing apparatus, an image forming apparatus, a computer program and a recording medium.
2. Description of Related Art
Digital image system has made rapid progress in recent years. As the digital image system progresses, construction of digital image processing technology is proceeded. For example, it is known that original documents are read by a scanner to generate digital files consisted of digital data, the generated digital files are reserved instead of the original documents, and the generated digital files are managed, in fields of copying machines with electrographic method or inkjet printing method, multi-function machines and the like. Furthermore, it is known that the generated digital files are compressed to be transmitted by e-mail.
Images obtained by scanners (scanned images) generally have large file sizes. Thus, it is required to compress the scanned images for accumulation or transmission.
In view of such situations, it is practical to use image compressing techniques based on separation of image layers, such as Mixed Raster Content (MRC), to compress such scanned images at high compression rate.
To generate a compressed image at high compression rate, the image compressing techniques based on separation of image layers firstly extract a foreground image mask representing a text and/or a line drawing from an original image to be compressed. On the basis of the extracted foreground image mask, the image compressing techniques then separate the original image into a foreground image layer and a background image layer. Each of the foreground image layer and the background image layer is finally compressed by a respective suitable compression way, to generate the compressed image at high compression rate (Japanese Patent Application Laid-Open No. 2002-94805, Japanese Patent No. 3779741).
The foreground image layer is an image layer for foreground representing a text and/or a line drawing, and is generally compressed by a lossless compression way, such as Joint Bi-level Image Group (JBIG), Modified Modified Read code (MMR), Lempel Ziv Welch (LZW), and the like.
On the other hand, the background image layer is an image layer for background representing image contents excluding a text and/or a line drawing, and is generally compressed by a lossy compression way, such as Joint Photographic Experts Group (JPEG), and the like.
The lossy compression ways are easy to control compression rate. Thus, image compressions can be performed by the lossy compression ways with priority to file size or image quality, in accordance with purposes of the compressed image. On the other hand, the lossless compression ways are difficult to control and increase compression rate.
In view of such difficulties, a conventional image compressing apparatus is known to further separate the foreground image layer that is separated from the original image (Japanese Patent Application Laid-Open No. 2004-229261). Thus, the conventional image compressing apparatus can compress the original image at higher compression rate by compressing the further separated foreground image layer, than by compressing directly the foreground image layer. In the conventional image compressing apparatus, one foreground image layer is generated by converting foreground colors of one original color image into β types of identifier (β: positive integer). The generated foreground image layer is then separated into β binary images. The separated binary images are respectively compressed.
Such conventional image compressing apparatus includes: a foreground image layer generating unit to generate the foreground image layer based on a color image; a binary image generating unit to generate the binary images in accordance with the foreground image layer; a binary image compressing unit to generate the compressed image by compressing the binary images; and an image memory to store at least one foreground image layer generated by the foreground image layer generating unit and β binary images generated by the binary image generating unit.
To separate one foreground image layer into β binary images, the foreground image layer is firstly read out and transmitted to the binary image generating unit. The binary image generating unit then generates one binary image among the β binary images. The generated one binary image is transmitted and stored in the image memory. These processes are repeated β times to obtain the β binary images. Anyway, all the β binary images are based on the same foreground image layer that is read out from the image memory and transmitted to the binary image generating unit.
An improvement is generally considered for efficient generation of the β binary images in accordance with one foreground image layer, to store the foreground image layer transmitted from the image memory into a buffer of the binary image generating unit and to generate the β binary images in accordance with the foreground image layer kept into the buffer. In this improvement, it is possible to reduce the numbers of transmission about the foreground image layer from the image memory to the binary image generating unit. In other words, the numbers of transmission are reduced from β into one, because same foreground image layer is repeatedly (β times) read out in the binary image generating unit. Thus, this improvement saves time required for inputting-outputting the foreground image layer and leads efficient generation of the binary images.
Additional buffer may be provided in the binary image generating unit to lead more efficient generation of the binary images.
Japanese Patent Application Laid-Open No. 2002-32749 discloses an image processing apparatus having line memories for image input and image output. In this image processing apparatus, images in the line memory for image input are firstly read out, n times faster than image input speed from image memory into the line memory for image input. The read out images are then performed image processings and written into the line memory for image output. The written images are finally outputted from the line memory for image output into the image memory, at the same speed as the image input speed. Thus, image processing speed can be performed at high speed in the image processing apparatus, even when images are transmitted at low speed outside the image processing apparatus.
Japanese Patent Application Laid-Open No. H7-320027 discloses another image processing apparatus including: plural image processing units; an image memory; and data bus control unit having a data packing function and a data unpacking function. In this image processing apparatus, images packed by the data bus control unit are stored in the image memory, and images unpacked by the data bus control unit are inputted into the image processing units. Thus, this image processing apparatus can save time required for inputting-outputting images, because packed images are transmitted to the image memory. In other words, this image processing apparatus can prevent a decrease in the processing rate when images are simultaneously inputted and outputted between each of the plural image processing units and the image memory.